class Meta < ActiveRecord::Base
  acts_as_tree :order => 'title'
  
  has_many :alternatives,
            :dependent => :destroy
  has_many :subject_words,
            :dependent => :destroy
  has_many :classifications,
            :dependent => :destroy
  has_many :publishers,
            :dependent => :destroy
  has_many :languages,
            :dependent => :destroy
  has_many :creators,
            :dependent => :destroy
  has_many :contributors,
            :dependent => :destroy
  has_many :audiences,
            :dependent => :destroy
  has_many :documents,
            :dependent => :destroy
  has_many :identifiers,
            :dependent => :destroy
  has_many :citations,
           :dependent => :destroy
  has_many :versions,
           :dependent => :destroy
  has_many :table_of_contents,
           :dependent => :destroy
  has_many :replaces,
           :dependent => :destroy
  has_many :dats,
           :dependent => :destroy
  has_many :locations,
           :dependent => :destroy
  has_many :snapshots,
           :dependent => :destroy
  
  belongs_to :type
  belongs_to :user
            
  validates_presence_of :title
  
  def set_validate
    self.validate_at = Time.now
  end
  
  def no_validate
    self.validate_at = nil
  end
end
